package com.yibing.test;

import java.util.Date;
import java.util.GregorianCalendar;

public class Employee implements Comparable<Employee> {

	public Employee(String n, double s, int y, int m, int d)
	{
		name = n;
		salary = s;
		hireDate = new GregorianCalendar(y, m, d).getTime();
	}
	
	public String getName() {
		return name;
	}
	
	public Date getHireDate() {
		return (Date)hireDate.clone();
	}
	
	public double getSalary() {
		return salary;
	}
	
	public void raiseSalary(double r) {
		salary += r;
	}

	@Override
	public int compareTo(Employee o) {
		return (int) Math.round(salary - o.salary);
	}
	
	private String name;
	private Date hireDate;
	private double salary;
}
